#include "glapp.h"
#include "renderer.h"

int state1 = 0;
int state2 = 0;
int state3 = 0;
float sliderValue = 0.5;
float sliderValue2 = 0.8;

int radioState = 0;

int comboState;
int comboSelected = 0;
int comboOptions = 5;
char* options[] = {"Option 1", "Option 2", "Option 3", "Option 4", "Option 5" }; 

void InitializeGame(){


}

int Update( event* e, float* dt ){

}


int Render(event *e, float* dt){

	glClearColor(0.3, 0.3, 0.3, 1.0);
	glClear(GL_COLOR_BUFFER_BIT);

	beginGUI(e);
		rect r;
		r.x = 30;
		r.y = 500;
		if (doButton(1, &r, "Button 1"))
			printf("Clicou 1\n");

		r.x = 130;
		r.y = 500;
		if (doButton(2, &r, "Button 2"))
			printf("Clicou 2\n");

		r.x = 230;
		r.y = 500;
		if (doCheckButton(3, &r, "Button 1", &state1))
			printf("Clicou checkbutton\n");

		r.x = 230;
		r.y = 470;
		if (doCheckButton(4, &r, "Button 2", &state2))
			printf("Clicou checkbutton\n");


		r.x = 230;
		r.y = 440;
		if (doCheckButton(5, &r, "Button 3", &state3))
			printf("Clicou checkbutton\n");


		r.x = 330;
		r.y = 500;
		if (doRadioButton(6, &r, "Radio 1", &radioState))
			printf("Clicou radiobutton 1\n");

		r.x = 330;
		r.y = 470;
		if (doRadioButton(7, &r, "Radio 2", &radioState))
			printf("Clicou radiobutton 2\n");


		r.x = 330;
		r.y = 440;
		if (doRadioButton(8, &r, "Radio 3", &radioState))
			printf("Clicou radiobutton 3\n");


		rect sliderRect;
		sliderRect.x = 450;
		sliderRect.y = 500;
		doHorizontalSlider(9, &sliderRect, &sliderValue);

		sliderRect.x = 450;
		sliderRect.y = 400;
		doVerticalSlider(10, &sliderRect, &sliderValue2);



	endGUI();


}


int main(){

	setVideoMode(800, 600, 0);
	warpMouse(0);
	initializeRenderer(800,  600, 0.1, 10000.0, 45.0);
//	setTextureSamplerState(CLAMP, LINEAR, LINEAR);
	initializeGUI(800, 600);
	InitializeGame();
	MainLoop( );

	return 0;
}
